from pages.base_page import BasePage
from appium.webdriver.common.appiumby import AppiumBy as By


class HomePage(BasePage):
    #定位器
    mine_page_locator = (By.XPATH,'(//android.widget.LinearLayout[@resource-id="com.xiachufang:id/icon"])[5]/android.widget.ImageView')
    collect_page_locator = (By.XPATH,'//android.widget.TextView[@resource-id="com.xiachufang:id/text" and @text="收藏"]')
    #进入我的页面
    def enter_mine_page(self):
        self.driver.find_element(*self.mine_page_locator).click()

    #进入收藏界面
    def enter_collect_page(self):
        self.driver.find_element(*self.collect_page_locator).click()

